package dk.ahp.opgave2;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class VelkomstActivity extends Activity implements OnClickListener {
	private Button forwardButton;
	private Button settingsButton;
	private Button helpButton;
	TextView headding;
	TextView status;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_velkomst);
        forwardButton = (Button) findViewById(R.id.buttonForward);
        settingsButton = (Button) findViewById(R.id.buttonSettings);
        helpButton = (Button) findViewById(R.id.buttonHelp);
        status = (TextView) findViewById(R.id.textViewStatus);
        headding = (TextView) findViewById(R.id.textViewHeading);
        forwardButton.setOnClickListener(this);
        settingsButton.setOnClickListener(this);
        helpButton.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_velkomst, menu);
        return true;
    }

    public void onClick(View k) {
     	if (forwardButton == k)
    	{
    		status.setText( R.string.forwardPressed );
    		System.out.println(R.string.forwardPressed + " blev trykket");
    		Log.d("Nu med Log.d", "argument 2");
    		Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:55.731653, 12.398829?z=16"));
    		startActivity(i);
    	}
     	else if (settingsButton == k)
     	{
     		status.setText( R.string.settingsPressed );
     		Intent i = new Intent(this, dk.ahp.opgave2.Act2.class);
     		i.putExtra("1", "streng 1");
     		startActivity(i);
     	}
     	else if (helpButton == k)
     	{
     		status.setText( R.string.helpPressed );
     	}
    }
}
